package com.gaohe.dcp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.dcp.mapper.DcpScaleScreenMapper;
import com.gaohe.dcp.domain.DcpScaleScreen;
import com.gaohe.dcp.service.IDcpScaleScreenService;

/**
 * 量表筛选Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class DcpScaleScreenServiceImpl implements IDcpScaleScreenService {
    @Autowired
    private DcpScaleScreenMapper dcpScaleScreenMapper;

    /**
     * 查询量表筛选
     *
     * @param scaleScreenId 量表筛选主键
     * @return 量表筛选
     */
    @Override
    public DcpScaleScreen selectDcpScaleScreenByScaleScreenId(Long scaleScreenId) {
        return dcpScaleScreenMapper.selectDcpScaleScreenByScaleScreenId(scaleScreenId);
    }

    /**
     * 查询量表筛选列表
     *
     * @param dcpScaleScreen 量表筛选
     * @return 量表筛选
     */
    @Override
    public List<DcpScaleScreen> selectDcpScaleScreenList(DcpScaleScreen dcpScaleScreen) {
        return dcpScaleScreenMapper.selectDcpScaleScreenList(dcpScaleScreen);
    }

    /**
     * 新增量表筛选
     *
     * @param dcpScaleScreen 量表筛选
     * @return 结果
     */
    @Override
    public int insertDcpScaleScreen(DcpScaleScreen dcpScaleScreen) {
        dcpScaleScreen.setCreateTime(DateUtils.getNowDate());
        return dcpScaleScreenMapper.insertDcpScaleScreen(dcpScaleScreen);
    }

    /**
     * 修改量表筛选
     *
     * @param dcpScaleScreen 量表筛选
     * @return 结果
     */
    @Override
    public int updateDcpScaleScreen(DcpScaleScreen dcpScaleScreen) {
        dcpScaleScreen.setUpdateTime(DateUtils.getNowDate());
        return dcpScaleScreenMapper.updateDcpScaleScreen(dcpScaleScreen);
    }

    /**
     * 批量删除量表筛选
     *
     * @param scaleScreenIds 需要删除的量表筛选主键
     * @return 结果
     */
    @Override
    public int deleteDcpScaleScreenByScaleScreenIds(Long[] scaleScreenIds) {
        return dcpScaleScreenMapper.deleteDcpScaleScreenByScaleScreenIds(scaleScreenIds);
    }

    /**
     * 删除量表筛选信息
     *
     * @param scaleScreenId 量表筛选主键
     * @return 结果
     */
    @Override
    public int deleteDcpScaleScreenByScaleScreenId(Long scaleScreenId) {
        return dcpScaleScreenMapper.deleteDcpScaleScreenByScaleScreenId(scaleScreenId);
    }


    //新增
    @Override
    public int addDcpScaleScreen(DcpScaleScreen dcpScaleScreen) {
        dcpScaleScreen.setCreateTime(DateUtils.getNowDate());
        dcpScaleScreen.setStatus(0L);
        dcpScaleScreen.setResult("暂未测评");
        return dcpScaleScreenMapper.insertDcpScaleScreen(dcpScaleScreen);
    }
    @Override
    public List<DcpScaleScreen> selectDcpScaleScreenByScaleId(Long sId) {
        return dcpScaleScreenMapper.selectDcpScaleScreenByScaleId(sId);
    }

}
